package com.buka.service;

import com.buka.pojo.LoginUser;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Service;

@Service("ps")
public class PermissionService {

    public boolean hasPermission(String permission) {
        LoginUser loginUser = (LoginUser) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
        if (loginUser.getUser().getId() == 1) {
            return true;
        }
        return false;
    }
}
